
var container = document.getElementById('image-container');
var images = container.getElementsByTagName('img');

var sortedImages = Array.from(images).sort(function(a, b) {
    return parseInt(a.getAttribute('idx')) - parseInt(b.getAttribute('idx'));
});

container.innerHTML = '';
sortedImages.forEach(function(img) {
    container.appendChild(img);
}); 
    
document.addEventListener('DOMContentLoaded', function() {
	const observer = lozad('.lozad', {
		rootMargin: '10px 0px', // 提前加载的距离
		threshold: 0.1 // 触发加载的阈值
	});		
	observer.observe();
});